package cn.meibang.aggragation.product.controller;

import cn.meibang.common.beauty.api.IProductAPIService;
import cn.meibang.common.beauty.provider.request.SearchApiRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 技师技能类型 <br>
 * 详细说明.
 * <p>
 *
 * @author yudw
 * @version 1.0
 */
@RestController
@RequestMapping("/product")
public class ProductController {

    private final Logger logger = LoggerFactory.getLogger(ProductController.class);

    @Autowired
    private IProductAPIService productAPIService;

    /**
     * 产品列表
     *
     * @param request
     */
    @RequestMapping(value = "/listProduct", method = RequestMethod.POST)
    public Object listProduct(@RequestBody SearchApiRequest request) {
        return productAPIService.listProduct(request.getPage(), request.getSize(), request.getItemName());
    }

    /**
     * 疗程列表
     *
     * @param request
     */
    @RequestMapping(value = "/listPacakge", method = RequestMethod.POST)
    public Object listPacakge(@RequestBody SearchApiRequest request) {
        return productAPIService.listPacakge(request.getPage(), request.getSize(), request.getItemName());
    }

    /**
     * 卡项，即服务
     *
     * @param request
     */
    @RequestMapping(value = "/listCard", method = RequestMethod.POST)
    public Object listCard(@RequestBody SearchApiRequest request) {
        return productAPIService.listCard(request.getPage(), request.getSize(), request.getItemName());
    }
}